<?php
$ex_data = isset($_['ex_data']) ? $_['ex_data'] : null;
$userQuota = PCompanyHelper::getUserQuota();
?>

<div id="event" class="modal interviewtime_dialog" style="position:absolute;">
   <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
      <h3>安排面试</h3>
   </div>
   <form id="event_form" type="post" action="<?php print_unescaped(OCP\Util::linkTo('calendar', 'ajax/event/new.php')); ?>">
      <?php print_unescaped($this->inc("part.eventform")); ?>
      <div class="control-group">
         <div class="controls" style="text-align:right; padding-right:30px;">
            <span id="errorbox" class="error" style="display:none;"></span>
            <?php if(isset($ex_data->type) && $ex_data->type == 1): ?><a id="previous_step" class="btn btn-info" style="margin-right:10px;" href="javascript:;">上一步</a><?php endif; ?>
            
            <?php if(empty($ex_data->validemail) && ($userQuota['sms_left'] <= 0 || empty($userQuota['email_sms_settings']['sms_offlineinterview_0d']))) {?>
            <button type="submit" class="ppp_graybtn btn-sure" style="cursor:default;" id="submitNewEvent">确认</button>
            <?php } else {?>
            <button type="submit" class="ppp_bluebtn btn-sure" id="submitNewEvent">确认</button>
            <?php }?>
            <a href="javascript:;" data-dismiss="modal" aria-hidden="true">取消</a>
            
         </div>
      </div>
      <input type="hidden" name="round" value="<?php echo isset($ex_data->round) ? $ex_data->round : 0;?>">
      <input type="hidden" name="interview_source" value="<?php echo isset($ex_data->source) ? $ex_data->source : '';?>">
      <input type="hidden" name="current_objectid" value="<?php echo isset($ex_data->objectid) ? $ex_data->objectid : 0;?>">
      <input type="hidden" name="interview_form_type" value="<?=PCalendarHelper::INTERVIEW_FORM_NEW ?>">
   </form>
   
     <div id="uploadcalendarform" name="uploadcalendarform" class="uploadform" style="position: absolute; left:91px; top:<?php echo $ex_data->type == 1 ? 360 : 320 ; ?>px; width:76px; height:20px;">
      <form style = "width:76px;height:20px;" id="uploadform" class="file_upload" action="<?php echo OC_Helper::linkToRoute('calendar_uploadinterviewfile');?>" method="POST" enctype="multipart/form-data">

         <div class="uploadbtn">
            <input class="inputfile" type="file" name="file" id="Fieldata" data-url="" title="支持最大4M的pdf、docx、doc、jpeg、png文件"/>
            <input type="hidden" name="requesttoken" value="<?php echo PSession::getFormToken();?>" id="requesttoken">
            <input type="hidden" name="filerealname" id="filerealname" value="" />
            <div class="btn-upload large" data-nodragtext="上传"></div>
         </div>
       </form>
       <div id="uploadcalendartable"  style="margin-top:-10px;">
          <table class="files">
             <tr class="file_upload_template" style="display:none;">
                <td class="file_upload_progress"><div></div></td>
             </tr>
          </table>
       </div> 
     </div>

</div>
